<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 300px;

        border: 1px solid #000;
        margin: 0 auto;
        padding: 20px;
        text-align: center;
      }
      .title {
        text-align: center;
      }
      .content {
        width: 100%;
        height: 100px;
      }
      .btn {
        margin-top: 20px;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="title">
        <h3>注册协议</h3>
      </div>
      <!-- 协议内容 -->
      <div class="content">
        <p>1. 注册协议</p>
        <p>2. 注册协议</p>
        <p>3. 注册协议</p>
      </div>
      <div class="btn">
        <button class="btn1">我已阅读协议(5s)</button>
        <button class="btn2">不同意</button>
      </div>
    </div>
    <script>
      const btn1 = document.querySelector(".btn1");
      btn1.disabled = true;
      let time = 5;
      let timer = setInterval(() => {
        time--;
        btn1.innerHTML = `我已阅读协议(${time}s)`;
        if (time <= 0) {
          clearInterval(timer);
          btn1.innerHTML = "同意";
          btn1.disabled = false;
        }
      }, 1000);

     
    </script>
  </body>
</html>
